package com.woniu.humanresource.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.woniu.humanresource.entity.Interviewer;

import java.util.ArrayList;
import java.util.List;

//文件导入
public class InterviewerListener extends AnalysisEventListener<Interviewer> {
    private static List<Interviewer> interviewerList = new ArrayList<>();
    @Override
    public void invoke(Interviewer Interviewer, AnalysisContext analysisContext) {
        interviewerList.add(Interviewer);
        System.out.println("解析到一条数据：" + Interviewer);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
        System.out.println("全部解析完成");
    }
//获取解析数据
    public static List<Interviewer> getInterviewerList() {
        return interviewerList;
    }
}
